package dataSource

import (
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

type MysqlInit struct {

}

func (mysqlInit *MysqlInit) NewMysqlInit() *gorm.DB {
	dsn := "root:new_password@tcp(127.0.0.1:3306)/we_chat?charset=utf8mb4&parseTime=True&loc=Local"
	db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
	if err != nil{
		panic("db error")
	}
	return db
}

